Skip to content

Comments

feat: implement puzzle bounty contract (closes #75)#107

Open
Mrwicks00 wants to merge 2 commits intoMindFlowInteractive:mainfrom
Mrwicks00:feature/puzzle-bounty-contract
Open

feat: implement puzzle bounty contract (closes #75)#107
Mrwicks00 wants to merge 2 commits intoMindFlowInteractive:mainfrom
Mrwicks00:feature/puzzle-bounty-contract

Conversation

@Mrwicks00
Copy link
Contributor

Pull Request: Puzzle Bounty & Sponsorship Contract (Fixes #75)

Closes #75

Description

Creates a new Soroban smart contract for the puzzle_bounty feature, allowing users to sponsor puzzle challenges with escrowed token rewards for first-solvers and fast completions.

Tasks Completed

  • Bounty Escrow Structure: Created create_bounty function forcing sponsors to deposit total rewards into the contract upfront.
  • First-solver Verification: Implemented claim_bounty which takes a solution_hash and checks rank claim order.
  • Multi-winner Support (Top 3): Contract configuration distributes descending rewards for 1st, 2nd, and 3rd rank claimants.
  • Leaderboard Integration: State map tracks winners, their ranks, solver addresses, and reward distributions.
  • Time-bound Expirations: Utilise expiration (duration from ledger().timestamp()) forcing claims to happen within standard duration.
  • Refund Unclaimed/Cancellations: Open/unclaimed bounties (or bounties passing expiration limit without solvers) can be reliably refunded or entirely cancelled by original sponsors via refund_expired and cancel_bounty functions.

Testing & Deployment

  • Added to workspace Cargo.toml.
  • Successfully ran full internal lifecycle (test.rs) without compiler errors.
  • Built & verified standalone WASM via standard testutils flag segregation.
  • Testnet Contract ID: CDXLH5SHGLXRV56FUGLGGCVYP3BW27MOLBH6Y5ANO6P4M7KFP24HIO27

@Mrwicks00
Copy link
Contributor Author

@Mkalbani please check

@Mkalbani
Copy link
Contributor

@Mrwicks00 Please resolve conflict

@Mrwicks00
Copy link
Contributor Author

@Mkalbani conflict has been successfully resolved, dont forget to assign me to other issues, I am active as hell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Puzzle Bounty and Sponsorship Contract

2 participants